//
//  PersonalViewController.h
//  Growth
//
//  Created by 洪波 陈 on 5/22/12.
//  Copyright (c) 2012 MEETStudio. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "WebConnection.h"
#import "WebConnetionArray.h"

#import "EGORefreshTableTailView.h"


#import "DiaryPhotoBrowseViewController.h"



#import "GrowthAppDelegate.h"


#import "FollowerViewController.h"

#import "HPGrowingTextView.h"

#import "TLDetailViewContentViewController.h"
#import "ASIHTTPConnection.h"
#import "TimelineUnitCell.h"
#import "PersonalLetterViewController.h"

typedef enum {
    kConnectionNone,
    kConnectionLoading,
    kConnectionDoneSuccess,
    kConnectionDoneError,
    
}ConnectionStateType;

@class GCDiscreetNotificationView;

@interface PersonalViewController : BaseViewController
<UITableViewDelegate,
UITableViewDataSource,
WebConnectionDelegate,
WebConnectionArrayDelegate,
EGORefreshTableTailDelegate,
UIPickerViewDelegate,
UIActionSheetDelegate,
HPGrowingTextViewDelegate,
ASIHTTPConnectionDelegate,
EGORefreshTableHeaderDelegate,
TimelineUnitCellDelegate
>
{
    IBOutlet UIActivityIndicatorView *userInfoLoadingActivity;
    IBOutlet UIActivityIndicatorView *diaryLoadingActivity;
    
    ConnectionStateType userInfoConnectionState;
    NSDictionary *userInfoDict;
    NSMutableArray *userDiaryArray;
    
    NSDictionary *userRelationDict;
    
    NSInteger userId;
    NSInteger userRelationIndex;
    
    int personalUserId;
    
    NSString *userRelationRequestStr;
    NSString *userDiaryRequsetStr;
    
    UITableView *myTableView;
    
    //无权限界面
    UIView *privacyView;
    UIView *privacyActionView;
    UIImageView *privacyUserIcon;
    UILabel *privacyUserNameLabel;
    UILabel *privacyDetailLabel;
    UILabel *privacyStateLabel;
    
    
    UIButton *privacyButton1;
    UIButton *privacyButton2;
    UIButton *privacyButton3;
    
    //Unhandle
    UIView *relationUnhandleView;
    UILabel *unhandleLabel1;
    UILabel *unhandleLabel2;
    UIButton *unhandleAcceptButton1;
    UIButton *unhandleAcceptButton2;
    UIButton *unhandleRejectButton1;
    UIButton *unhandleRejectButton2;

    
    //下拉刷新
	EGORefreshTableHeaderView *_refreshHeaderView;
	BOOL _HeaderReloading;
    
    //上拉拉刷新
	EGORefreshTableTailView *_refreshTailView;
	BOOL _TailReloading;

    int pageNo;

    
    //封面
    UIImageView *covorImageView;
    BOOL moving;
    BOOL isCellHeadAdd;
    
      NSMutableArray *imagesURL;

    
    //家人角色
    int familyRoleId;
    NSArray *familyRoleArray;
    IBOutlet UILabel *familyRoleLabel;
    IBOutlet UIView *selFamilyRoleView;
    IBOutlet  UIPickerView *familyRolePickerView;
    
    //私信输入框
    //GRowing TextView 
    UIView *containerView;
    HPGrowingTextView *textView;
    IBOutlet UIButton *backGoundButton;
    
    
    //
    IBOutlet UIButton *followButton;

}

//操作提示
@property (nonatomic, retain) GCDiscreetNotificationView *notificationView;

@property (nonatomic, retain) NSDictionary *userInfoDict;
@property (nonatomic, retain) NSMutableArray *userDiaryArray;

@property (nonatomic,retain)   NSDictionary *userRelationDict;

@property (nonatomic) NSInteger userId;

@property (nonatomic, retain) NSString *userRelationRequestStr;
@property (nonatomic, retain) NSString *userDiaryRequsetStr;

@property (nonatomic, retain) IBOutlet UITableView *myTableView;

@property (nonatomic,retain)   NSArray *familyRoleArray;


//无权限界面
@property (nonatomic, retain) IBOutlet UIView *privacyView;
@property (nonatomic, retain) IBOutlet UIView *privacyActionView;
@property (nonatomic, retain) IBOutlet UIImageView *privacyUserIcon;
@property (nonatomic, retain) IBOutlet UILabel *privacyUserNameLabel;
@property (nonatomic, retain) IBOutlet UILabel *privacyDetailLabel;
@property (nonatomic, retain) IBOutlet UILabel *privacyStateLabel;

@property (nonatomic, retain) IBOutlet UIButton *privacyButton1;
@property (nonatomic, retain) IBOutlet UIButton *privacyButton2;
@property (nonatomic, retain) IBOutlet UIButton *privacyButton3;

//Handle
//Unhandle
@property (nonatomic, retain) IBOutlet UIView *relationUnhandleView;
@property (nonatomic, retain) IBOutlet UILabel *unhandleLabel1;
@property (nonatomic, retain) IBOutlet UILabel *unhandleLabel2;
@property (nonatomic, retain) IBOutlet UIButton *unhandleAcceptButton1;
@property (nonatomic, retain) IBOutlet UIButton *unhandleAcceptButton2;
@property (nonatomic, retain) IBOutlet UIButton *unhandleRejectButton1;
@property (nonatomic, retain) IBOutlet UIButton *unhandleRejectButton2;



- (id)initWithUserId:(int)uid;
- (id)initWithUserId:(int)uid userName:(NSString *)userName;
- (id)initWithUserDict:(NSDictionary *)dict;

//滑动相册
- (void)toPhotoBook:(NSArray *)images;
-(NSMutableArray *)getImages;



- (void)toBabyTimelineView:(id)sender;

//接受好友邀请
- (IBAction)acceptFreindInvite;
- (IBAction)inviteFreind:(id)sender;

//


//发送私信
- (IBAction)sendLetter:(id)sender;

-(void)resignTextView;
- (void)initGrowingTextView;
- (IBAction)backGroundTap;
-(IBAction)postLetter:(id)sender;

//家人邀请

- (IBAction)acceptFamilyInvite;
- (IBAction)inviteFamily:(id)sender;

- (IBAction)selFamilyRoleACtion:(id)sender;

- (IBAction)cancelInviteAction:(id)sender;

- (void)loadFamilyRoleData;

- (void)doneLoadingTableViewData;


- (IBAction)myPrivateLetter:(id)sender;

@end
